3 Every aspect of flight dynamics is controlled by the selected "PID controller". This is an algorithm which is
4 responsible for reacting to your stick inputs and keeping the craft stable in the air by using the gyroscopes and/or
5 accelerometers (depending on your flight mode).
7 The "PIDs" are a set of tuning parameters which control the operation of the PID controller. The optimal PID settings
8 to use are different on every craft, so if you can't find someone with your exact setup who will share their settings
9 with you, some trial and error is required to find the best performing PID settings.
11 A video on how to recognise and correct different flight problems caused by PID settings is available here:
13 https://www.youtube.com/watch?v=YNzqTGEl2xQ
15 Basically, the goal of the PID controller is to bring the craft's rotation rate in all three axes to the rate that
16 you're commanding with your sticks. An error is computed which is the difference between your target rotation rate and
17 the actual one measured by the gyroscopes, and the controller tries to bring this error to zero.
21 * For fixed wing, a PIFF controller is used. Some documentation is available in the wiki and legacy release notes.
22 * The INAV Configurator provides conservative example PID settings for various aircraft types. These will require tuning to a particular machine.
26 **The P term** controls the strength of the correction that is applied to bring the craft toward the target angle or
27 rotation rate. If the P term is too low, the craft will be difficult to control as it won't respond quickly enough to
28 keep itself stable. If it is set too high, the craft will rapidly oscillate/shake as it continually overshoots its
31 **The I term** corrects small, long term errors. If it is set too low, the craft's attitude will slowly drift. If it is
32 set too high, the craft will oscillate (but with slower oscillations than with P being set too high).
34 **The D term** attempts to increase system stability by monitoring the rate of change in the error. If the error is rapidly converging to zero, the D term causes the strength of the correction to be backed off in order to avoid overshooting the target.
37 ## TPA and TPA Breakpoint
39 TPA stands for Throttle PID Attenuation and according to [AlexYork.net](http://blog.alexyorke.net/what-is-tpa/):
41 > "TPA basically allows an aggressively tuned multi-rotor (one that feels very locked in) to reduce its PID gains when throttle is applied beyond the TPA threshold/breakpoint in order to eliminate fast oscillations.."
43 Note that TPA is set via CLI or on the PID TUNING tab of the GUI. tpa_breakpoint is set via CLI
45 Also note that TPA and tpa_breakpoint may not be used in certain PID Controllers. Check the description on the individual controller.
47 TPA applies a PID value reduction in relation to full Throttle. It is used to apply dampening of PID values as full throttle is reached.
49 **TPA** = % of dampening that will occur at full throttle.
51 **tpa_breakpoint** = the point in the throttle curve at which TPA will begin to be applied.
53 An Example: With TPA = 50 (or .5 in the GUI) and tpa_breakpoint = 1500 (assumed throttle range 1000 - 2000)
55 * At 1500 on the throttle channel, the PIDs will begin to be dampened.
56 * At 3/4 throttle (1750), PIDs are reduced by approximately 25% (half way between 1500 and 2000 the dampening will be 50% of the total TPA value of 50% in this example)
57 * At full throttle (2000) the full amount of dampening set in TPA is applied. (50% reduction in this example)
58 * TPA can lead into increase of rotation rate when more throttle applied.
60 ![tpa example chart](https://cloud.githubusercontent.com/assets/1668170/6053290/655255dc-ac92-11e4-9491-1a58d868c131.png "TPA Example Chart")
63 **How and Why to use this?**
65 If you are getting oscillations starting at say 3/4 throttle, set tpa breakpoint = 1750 or lower (remember, this is assuming your throttle range is 1000-2000), and then slowly increase TPA until your oscillations are gone. Usually, you will want tpa breakpoint to start a little sooner then when your oscillations start so you'll want to experiment with the values to reduce/remove the oscillations.
69 INAV has a single built-in PID controller. The PID controller scaling
70 means that Betaflight PIDs should be comparable.
72 Note that very old INAV versions had more PID controllers. These have been removed.
75 ## RC rate, Pitch and Roll Rates (P/R rate before they were separated), and Yaw rate
79 An overall multiplier on the RC stick inputs for pitch, rol;, and yaw.